package com.backend.mapper.rbac;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.pojo.dto.UpdateRoleNameDTO;
import com.pojo.entity.Role;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface RoleMapper extends BaseMapper<Role> {
    Integer removeRoleByUsername(@Param("username") String username);
    @Select("select * from role")
    List<Role> getAllRoles();

    Integer updateRoleName(UpdateRoleNameDTO updateRoleNameDTO);

    Role getRoleByName(@Param("name") String name);

    Integer updateRoleStatus(@Param("name") String name, @Param("status") Integer status);
}
